#!/usr/bin/env python
# coding=utf-8
#__author__ = 'Yunchao Ling'

import time
import sys

time1=time.time()

infile=open(sys.argv[1],"r")
outfile=open(sys.argv[1]+".maxlength","w")

namelist={0:"seqid",1:"source",2:"type",3:"start",4:"end",5:"score",6:"strand",7:"phase",8:"attributes"}
maxvalue={"seqid":0,"source":0,"type":0,"start":0,"end":0,"score":0,"strand":0,"phase":0,"attributes":0}

for line in infile:
    line=line.rstrip("\n")
    if not line.startswith("#"):
        splitline=line.split("\t")
        for i in range(len(splitline)):
            length=len(splitline[i])
            if length>maxvalue[namelist[i]]:
                maxvalue[namelist[i]]=length
        info=splitline[8]
        if not info==".":
            splitinfo=info.split(";")
            for item in splitinfo:
                splititem=item.split("=")
                name=splititem[0]
                value=splititem[1]
                length=len(value)
                if maxvalue.has_key(name):
                    if length>maxvalue[name]:
                        maxvalue[name]=length
                else:
                    maxvalue[name]=length
infile.close()
outfile.write(str(maxvalue))
outfile.close()





